#16 new
rwl

Uninitialized Constant By Password

Reported by rwl | September 6th, 2008 @ 07:27 PM

Hi there, sorry to post a ticket, but i have been unable to figure this one out.

No matter how i install restful auth, i run into this on production:

NameError (uninitialized constant Authentication::ByPassword::ModelClassMethods::REST_AUTH_SITE_KEY):

i have rails frozen to 2.1 and did the submodule clone from git hub.

Should i just try to clone it to the rails folder and delete the repo?

it works fine on dev.

thanks

Comments and changes to this ticket

  • MegaPrime

    MegaPrime September 26th, 2008 @ 03:14 AM

    Hi,

    I just hit this problem and after digging around I found out that the issue was a missing site_keys.rb file in my config/initializers/ folder.

    For some reason it had been skipped by SVN (Netbeans) and wasn't uploaded.

    Once I uploaded the file (it stores the REST_AUTH_SITE_KEY value) everything worked fine like it did in Dev.

    hope this helps.

  • Attila Györffy

    Attila Györffy October 21st, 2008 @ 10:22 AM

    @MegaPrime: Thanks for your help, I had the same problem and your idea just worked.

  • macajueli

    macajueli January 26th, 2009 @ 07:33 AM

    • Tag set to restful_authentication

    I'm using herokugarden, I have the file mentioned above in my config/initializers folder but I still get the same error mentioned previously: NameError in MembersController#create

    uninitialized constant Authentication::ByPassword::ModelClassMethods::REST_AUTH_SITE_KEY

    below is the full trace:

    /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:275:in load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:inconst_missing' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:31:in password_digest' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:46:inencrypt' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:57:in encrypt_password' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:insend' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:in evaluate_method' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:161:incall' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:93:in run' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:92:ineach' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:92:in send' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:92:inrun' /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:272:in run_callbacks' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/callbacks.rb:298:incallback' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/callbacks.rb:206:in create_or_update' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2200:insave_without_validation' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/validations.rb:901:in save_without_dirty' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/dirty.rb:75:insave_without_transactions' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:106:in save' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:66:intransaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:79:in transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:98:intransaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:106:in save' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:118:inrollback_active_record_state!' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:106:in save' app/controllers/members_controller.rb:14:increate' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:inperform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:inperform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in perform_action_without_rescue_without_timeout' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in perform_action_without_rescue_without_timeout' /home/userapps_plugins/preload/request_timeout/lib/request_timeout.rb:9:inperform_action_without_rescue' /usr/lib/ruby/1.8/timeout.rb:48:in timeout' /home/userapps_plugins/preload/request_timeout/lib/request_timeout.rb:8:inperform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in perform_action_without_caching' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:inperform_action' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:incache' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:insend' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:inprocess_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:inprocess' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in handle_request' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:indispatch' /usr/lib/ruby/1.8/thread.rb:135:in synchronize' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:indispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in dispatch_cgi' /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:indispatch' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:54:in serve_rails' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:74:incall' /home/heroku_rack/lib/toolbar.rb:15:in call' /home/heroku_rack/lib/static_assets.rb:9:incall' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/urlmap.rb:42:in call' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/urlmap.rb:35:ineach' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/urlmap.rb:35:in call' /usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/builder.rb:53:incall' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:59:in pre_process' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:50:inprocess' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:35:in receive_data' /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:inrun_machine' /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in run' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/backends/base.rb:45:instart' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/server.rb:146:in start' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/controllers/controller.rb:79:instart' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in send' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:inrun_command' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:136:in run!' /usr/lib/ruby/gems/1.8/gems/thin-0.8.2/bin/thin:6 /usr/bin/thin:19:inload' /usr/bin/thin:19

    Request

    Parameters:

    {"commit"=>"Sign up", "authenticity_token"=>"29d79264559249bef2a6494af1f1d0e0fd07919d", "member"=>{"password_confirmation"=>"", "login"=>"joe123", "password"=>"", "email"=>"joe@blow.com"}}

  • macajueli

    macajueli January 26th, 2009 @ 08:40 AM

    I put the two constants from site_keys.rb in the by_password.rb file and it works now as a temporary solution.

  • macajueli

    macajueli January 26th, 2009 @ 08:43 AM

    that file can be found here for noobs like me: const_missing' vendor/plugins/restful-authentication/lib/authentication/by_password.rb:31:in password_digest'

  • Sergey Avseyev

    Sergey Avseyev June 28th, 2009 @ 08:15 AM

    • Assigned user cleared.

    Simply preform
    $ rake auth:gen:site_key

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Restful Authentication Generator

This widely-used plugin provides a foundation for securely managing user
authentication:
* Login / logout
* Secure password handling
* Account activation by validating email
* Account approval / disabling by admin
* Rudimentary hooks for authorization and access control.

http://github.com/technoweenie/restful-authentication/tree

Pages